<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Kyoto Cabinet: kyotocabinet::Mutex Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Kyoto Cabinet
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacekyotocabinet.html">kyotocabinet</a>      </li>
      <li class="navelem"><a class="el" href="classkyotocabinet_1_1Mutex.html">Mutex</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a>  </div>
  <div class="headertitle">
<div class="title">kyotocabinet::Mutex Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="kyotocabinet::Mutex" -->
<p>Basic mutual exclusion device.  
 <a href="classkyotocabinet_1_1Mutex.html#details">More...</a></p>

<p><code>#include &lt;kcthread.h&gt;</code></p>

<p><a href="classkyotocabinet_1_1Mutex-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7e">Type</a> { <a class="el" href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7ea53baa22869179c94e28fb68cfa588e47">FAST</a>, 
<a class="el" href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7ea1425715dd72a73530e5030c95f4c7cb0">ERRORCHECK</a>, 
<a class="el" href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7eaebbd30a6b7f24d05e5d03ae2a42bb032">RECURSIVE</a>
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Type of the behavior for double locking.  <a href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7e">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#a036a7fe157fca1c6d0d6d3979f2d0115">Mutex</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#a036a7fe157fca1c6d0d6d3979f2d0115"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#a65216b0d0edb15e1b88a9dd78f3537ce">Mutex</a> (<a class="el" href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7e">Type</a> type)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a65216b0d0edb15e1b88a9dd78f3537ce"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#a58abd9a1f3193f727422b94579155623">~Mutex</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#a58abd9a1f3193f727422b94579155623"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#a96d6f35b0801edc5223458f7239f439b">lock</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the lock.  <a href="#a96d6f35b0801edc5223458f7239f439b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#a02d117cbbf900c9458253dacee2f4d8e">lock_try</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to get the lock.  <a href="#a02d117cbbf900c9458253dacee2f4d8e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#a9da8b318a447648cf3da8bdf29c021e3">lock_try</a> (double sec)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to get the lock.  <a href="#a9da8b318a447648cf3da8bdf29c021e3"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classkyotocabinet_1_1Mutex.html#ae4bd6162c67ca7775dee5d1eb18f3be5">unlock</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Release the lock.  <a href="#ae4bd6162c67ca7775dee5d1eb18f3be5"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="friends"></a>
Friends</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7f15caac4fd04184afa33f61e738fb41"></a><!-- doxytag: member="kyotocabinet::Mutex::CondVar" ref="a7f15caac4fd04184afa33f61e738fb41" args="" -->
class&#160;</td><td class="memItemRight" valign="bottom"><b>CondVar</b></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Basic mutual exclusion device. </p>
</div><hr/><h2>Member Enumeration Documentation</h2>
<a class="anchor" id="afa7e2cbff2d5f9fd22ecdb00a79faa7e"></a><!-- doxytag: member="kyotocabinet::Mutex::Type" ref="afa7e2cbff2d5f9fd22ecdb00a79faa7e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7e">kyotocabinet::Mutex::Type</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Type of the behavior for double locking. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="afa7e2cbff2d5f9fd22ecdb00a79faa7ea53baa22869179c94e28fb68cfa588e47"></a><!-- doxytag: member="FAST" ref="afa7e2cbff2d5f9fd22ecdb00a79faa7ea53baa22869179c94e28fb68cfa588e47" args="" -->FAST</em>&nbsp;</td><td>
<p>no operation </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7e2cbff2d5f9fd22ecdb00a79faa7ea1425715dd72a73530e5030c95f4c7cb0"></a><!-- doxytag: member="ERRORCHECK" ref="afa7e2cbff2d5f9fd22ecdb00a79faa7ea1425715dd72a73530e5030c95f4c7cb0" args="" -->ERRORCHECK</em>&nbsp;</td><td>
<p>check error </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="afa7e2cbff2d5f9fd22ecdb00a79faa7eaebbd30a6b7f24d05e5d03ae2a42bb032"></a><!-- doxytag: member="RECURSIVE" ref="afa7e2cbff2d5f9fd22ecdb00a79faa7eaebbd30a6b7f24d05e5d03ae2a42bb032" args="" -->RECURSIVE</em>&nbsp;</td><td>
<p>allow recursive locking </p>
</td></tr>
</table>
</dd>
</dl>

</div>
</div>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a036a7fe157fca1c6d0d6d3979f2d0115"></a><!-- doxytag: member="kyotocabinet::Mutex::Mutex" ref="a036a7fe157fca1c6d0d6d3979f2d0115" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classkyotocabinet_1_1Mutex.html#a036a7fe157fca1c6d0d6d3979f2d0115">kyotocabinet::Mutex::Mutex</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Default constructor. </p>

</div>
</div>
<a class="anchor" id="a65216b0d0edb15e1b88a9dd78f3537ce"></a><!-- doxytag: member="kyotocabinet::Mutex::Mutex" ref="a65216b0d0edb15e1b88a9dd78f3537ce" args="(Type type)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classkyotocabinet_1_1Mutex.html#a036a7fe157fca1c6d0d6d3979f2d0115">kyotocabinet::Mutex::Mutex</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classkyotocabinet_1_1Mutex.html#afa7e2cbff2d5f9fd22ecdb00a79faa7e">Type</a>&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td><code> [explicit]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructor. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the behavior for double locking. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a58abd9a1f3193f727422b94579155623"></a><!-- doxytag: member="kyotocabinet::Mutex::~Mutex" ref="a58abd9a1f3193f727422b94579155623" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classkyotocabinet_1_1Mutex.html#a58abd9a1f3193f727422b94579155623">kyotocabinet::Mutex::~Mutex</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a96d6f35b0801edc5223458f7239f439b"></a><!-- doxytag: member="kyotocabinet::Mutex::lock" ref="a96d6f35b0801edc5223458f7239f439b" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classkyotocabinet_1_1Mutex.html#a96d6f35b0801edc5223458f7239f439b">kyotocabinet::Mutex::lock</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the lock. </p>

</div>
</div>
<a class="anchor" id="a02d117cbbf900c9458253dacee2f4d8e"></a><!-- doxytag: member="kyotocabinet::Mutex::lock_try" ref="a02d117cbbf900c9458253dacee2f4d8e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classkyotocabinet_1_1Mutex.html#a02d117cbbf900c9458253dacee2f4d8e">kyotocabinet::Mutex::lock_try</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Try to get the lock. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on success, or false on failure. </dd></dl>

</div>
</div>
<a class="anchor" id="a9da8b318a447648cf3da8bdf29c021e3"></a><!-- doxytag: member="kyotocabinet::Mutex::lock_try" ref="a9da8b318a447648cf3da8bdf29c021e3" args="(double sec)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classkyotocabinet_1_1Mutex.html#a02d117cbbf900c9458253dacee2f4d8e">kyotocabinet::Mutex::lock_try</a> </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>sec</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Try to get the lock. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">sec</td><td>the interval of the suspension in seconds. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true on success, or false on failure. </dd></dl>

</div>
</div>
<a class="anchor" id="ae4bd6162c67ca7775dee5d1eb18f3be5"></a><!-- doxytag: member="kyotocabinet::Mutex::unlock" ref="ae4bd6162c67ca7775dee5d1eb18f3be5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classkyotocabinet_1_1Mutex.html#ae4bd6162c67ca7775dee5d1eb18f3be5">kyotocabinet::Mutex::unlock</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Release the lock. </p>

</div>
</div>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Fri May 25 2012 01:21:36 for Kyoto Cabinet by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
